<template>
	<el-container>
		<el-header style="height: auto;">
			<sc-select-filter :data="filterData" :label-width="80" @on-change="filterChange"></sc-select-filter>
		</el-header>
		<el-main class="nopadding">
			<scTable ref="table" :apiObj="apiObj" row-key="roleId" stripe>
				<el-table-column label="#" type="index" width="50"></el-table-column>
				<el-table-column label="模块名称" prop="moduleTitle" width="100"></el-table-column>
				<el-table-column label="审批人" prop="approvalUserName" width="100"></el-table-column>
				<el-table-column label="操作类型" prop="optType" width="80"></el-table-column>
				<el-table-column label="审批状态" prop="status" width="120">
					<template #default="scope">
						<el-button type="success" size="small" v-if="scope.row.status==='1'">同意</el-button>
						<el-button type="danger" size="small" v-else-if="scope.row.sex==='2'">不同意</el-button>
						<el-button type="info" size="small" v-else>等审批</el-button>
					</template>
				</el-table-column>
				<el-table-column label="审批时间" prop="approvalTime" width="150"></el-table-column>
				<el-table-column label="事件说明" prop="remark" width="300" :show-overflow-tooltip="true"></el-table-column>
				<el-table-column label="审批意见" prop="approvalRemark" width="300" :show-overflow-tooltip="true"></el-table-column>
			</scTable>
		</el-main>
	</el-container>
</template>

<script>
import scSelectFilter from '@/components/scSelectFilter'
export default {
	components: {
		scSelectFilter,
	},
	name: 'Three Member Security',
	data() {
		return {
			apiObj: this.$API.system.sysSecurity.getSysSecurityEventList,
			selection: [],
			filterData: [
				{
					title: "日期范围",
					key: "date",
					multiple: false,
					options: [
						{
							label: "全部",
							value: ""
						},
						{
							label: "今日",
							value: "1"
						},
						{
							label: "昨日",
							value: "2"
						},
						{
							label: "一周内",
							value: "3"
						},
						{
							label: "一月内",
							value: "4"
						},
						{
							label: "一月前",
							value: "5"
						}
					]
				},
				{
					title: "操作方式",
					key: "optType",
					multiple: false,
					options:[{
						label: "全部",
						value: ""
					},
						{
							label: "添加",
							value: "insert"
						},
						{
							label: "删除",
							value: "delete"
						},
						{
							label: "更新",
							value: "update"
						}
					]
				},
				{
					title: "业务模块",
					key: "module",
					multiple: false,
					options: [{
						value: '',
						label: '全部'
					},{
						value: 'unit',
						label: '单位信息'
					},{
						value: 'userInfo',
						label: '用户信息'
					},{
						value: 'unitDept',
						label: '部门信息'
					},{
						value: 'userRole',
						label: '用户权限'
					},{
						value: 'userLevel',
						label: '行政级别'
					}],
				}
			],
			search: {
				date:'',
				optType: '',
				module:''
			}
		}
	},
	mounted() {
	},
	methods: {
		filterChange(data){
			this.search.date = data.date;
			this.search.optType = data.optType;
			this.search.module = data.module;
			this.$refs.table.upData(this.search)
		},
	}
}
</script>

<style>
</style>
